package com.proxy.dynamicProxy;

public class test {
    public static void main(String[] args) {
        Host host = new Host();
        Host_1 host_1 = new Host_1();
        host.rent();
        host_1.rent();
        System.out.println("-------------------------------");
        // 创建代理对象
        ProxyInvocationHandler pih = new ProxyInvocationHandler(host);
        Rent rentProxy = (Rent) pih.getProxy();
        rentProxy.rent();
        System.out.println("-------------------------------");
        ProxyInvocationHandler pih_1 = new ProxyInvocationHandler(host_1);
        Rent rentProxy_1 = (Rent) pih_1.getProxy();
        rentProxy_1.rent();
    }
}
